/**
 * Description:
 * Class Name:SynchronizedTest
 * Date:2022/3/14 16:13
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第8章_Java集合._8_8_操作集合的工具类_Collections._8_8_3_同步控制;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;

public class SynchronizedTest {
    public static void main(String[] args) {
        // 下面程序创建了4个线程安全的集合对象
        var c = Collections.synchronizedCollection(new ArrayList());
        var list = Collections.synchronizedList(new ArrayList<>());
        var s = Collections.synchronizedSet(new HashSet<>());
        var m = Collections.synchronizedMap(new HashMap<>());
    }
}
